package com.ruoyi.intelligence.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.intelligence.mapper.SysEquipmentMapper;
import com.ruoyi.intelligence.domain.SysEquipment;
import com.ruoyi.intelligence.service.ISysEquipmentService;

/**
 * 设备列表Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-08-26
 */
@Service
public class SysEquipmentServiceImpl implements ISysEquipmentService 
{
    @Autowired
    private SysEquipmentMapper sysEquipmentMapper;

    /**
     * 查询设备列表
     * 
     * @param equipmentId 设备列表ID
     * @return 设备列表
     */
    @Override
    public SysEquipment selectSysEquipmentById(Long equipmentId)
    {
        return sysEquipmentMapper.selectSysEquipmentById(equipmentId);
    }

    /**
     * 查询设备列表列表
     * 
     * @param sysEquipment 设备列表
     * @return 设备列表
     */
    @Override
    public List<SysEquipment> selectSysEquipmentList(SysEquipment sysEquipment)
    {
        return sysEquipmentMapper.selectSysEquipmentList(sysEquipment);
    }

    /**
     * 新增设备列表
     * 
     * @param sysEquipment 设备列表
     * @return 结果
     */
    @Override
    public int insertSysEquipment(SysEquipment sysEquipment)
    {
        sysEquipment.setCreateTime(DateUtils.getNowDate());
        return sysEquipmentMapper.insertSysEquipment(sysEquipment);
    }

    /**
     * 修改设备列表
     * 
     * @param sysEquipment 设备列表
     * @return 结果
     */
    @Override
    public int updateSysEquipment(SysEquipment sysEquipment)
    {
        sysEquipment.setUpdateTime(DateUtils.getNowDate());
        return sysEquipmentMapper.updateSysEquipment(sysEquipment);
    }

    /**
     * 批量删除设备列表
     * 
     * @param equipmentIds 需要删除的设备列表ID
     * @return 结果
     */
    @Override
    public int deleteSysEquipmentByIds(Long[] equipmentIds)
    {
        return sysEquipmentMapper.deleteSysEquipmentByIds(equipmentIds);
    }

    /**
     * 删除设备列表信息
     * 
     * @param equipmentId 设备列表ID
     * @return 结果
     */
    @Override
    public int deleteSysEquipmentById(Long equipmentId)
    {
        return sysEquipmentMapper.deleteSysEquipmentById(equipmentId);
    }
}
